# BSD 3-Clause Clear License
# Copyright © 2025 ZAMA. All rights reserved.

OUTDIR=$PROJECT_DIR/versal/output_psi64
TOP_NAME=top_hpu
TOP_TOP=TOP_TOP_hpu
PEP_MSPLIT=PEP_MSPLIT_main2_subs2
PEP_BATCH=PEP_BATCH_bpbs12_tpbs27
TOP_PCMAX=TOP_PCMAX_pem2_glwe1_bsk16_ksk16
TOP_PC=TOP_PC_pem2_glwe1_bsk8_ksk16
APPLICATION=APPLI_msg2_carry2_pfail128_132b_tuniform_144a47
NTT_MOD=NTT_MOD_goldilocks
NTT_CORE_ARCH=NTT_CORE_ARCH_gf64
NTT_CORE_R=NTT_CORE_R_2
NTT_CORE_PSI=NTT_CORE_PSI_64
NTT_CORE_RDX_CUT=NTT_CORE_RDX_CUT_n5c6
NTT_CORE_DIV=NTT_CORE_DIV_1
BSK_SLOT=BSK_SLOT_8
BSK_CUT=BSK_CUT_8
KSK_SLOT=KSK_SLOT_8
KSK_CUT=KSK_CUT_16
KSLB=KSLB_x3y64z3
HPU_PART=HPU_PART_gf64
AXI_DATA_W=AXI_DATA_W_256
REGF_STRUCT=REGF_STRUCT_reg64_coef32_seq4

INTER_PART_PIPE=2

just --set OUTDIR $OUTDIR build $TOP_NAME gen "-F TOP_TOP $TOP_TOP -F PEP_MSPLIT $PEP_MSPLIT -F PEP_BATCH $PEP_BATCH -F TOP_PCMAX $TOP_PCMAX -F TOP_PC $TOP_PC -F APPLICATION $APPLICATION -F NTT_MOD $NTT_MOD -F NTT_CORE_ARCH $NTT_CORE_ARCH -F NTT_CORE_R $NTT_CORE_R -F NTT_CORE_PSI $NTT_CORE_PSI -F NTT_CORE_RDX_CUT $NTT_CORE_RDX_CUT -F NTT_CORE_DIV $NTT_CORE_DIV -F BSK_SLOT $BSK_SLOT -F BSK_CUT $BSK_CUT -F KSK_SLOT $KSK_SLOT -F KSK_CUT $KSK_CUT -F KSLB $KSLB -F HPU_PART $HPU_PART -F AXI_DATA_W $AXI_DATA_W -F REGF_STRUCT $REGF_STRUCT" "P:INTER_PART_PIPE=${INTER_PART_PIPE} D:MEMORY_FILE_PATH=\\\"${PROJECT_DIR}/hw/\\\""| tee build_out_psi64.log
